package com.xxx.base.service;

import com.xxx.base.spring.BaseBean;
import com.xxx.base.spring.Monitor;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class TestService extends BaseBean {
//    @Autowired
//    TestDao    testDao;
//
//
    @Async
    @Monitor(trace = true)
    public void async(String p) {
        // TestService me = me();
        log.info("async method....");
    }


    @Monitor(trace = true)
    public void monitor(String p) {
        log.info("monitor method....");
    }


    @Cacheable(value = "aaa", key = "#userId")
    public void cache(Long userId, String couponId) {
        log.info("cache");
    }

        public static void main(String[] args){
            String s = "123abc123";
            System.out.println(s.replace("123","xxx"));
            System.out.println(s.replaceAll("123","xxx"));
            System.out.println(s.replaceFirst("123","xxx"));
        }
}
